#!/bin/bash

echo

if [ -d "build" ]
then
  echo "A build directory already exist, do you want to recompile everything ? [Y/n] "
  read answer
  if [ $answer = "Y" ]
  then
    echo "Erasing previous build"
    \rm -Rf build
    echo "Building everything"
  else
    echo "Updating build"
  fi
else
  echo "Building everything"
fi

\mkdir build
\cd build
cmake ../
make

echo "Go into the \"build/demos\" subdir to launch the demos \"scroll\" and \"snow\""
echo

